import Mock from 'mockjs'; // 引入mockjs
import Qs from 'qs';
const Random = Mock.Random;  // Mock.Random 是一个工具类，用于生成各种随机数据
const VITE_API_URL = import.meta.env.VITE_APP_BASE_API;


//  接口/mall4cloud_product/ua/spu/prod_info
Mock.mock(
  new RegExp(VITE_API_URL + '/mall4cloud_product/ua/spu/prod_info' + '.*'),
  'get',
  (options?: object): any => {
    let tempObj = {
      shopId:Random.guid(),
      name:Random.ctitle(2,5),
      mainImgUrl:Random.image('200x100', '#FF6600'),
      deliveryModeVO:{},
      detail:Random.cparagraph(),
      imgUrls:''+Random.image('200x100', '#FF6600')+','+Random.image('200x100', '#FF6600')+','+Random.image('200x100', '#FF6600'),
      skus:[],
      priceFee:Random.integer(30000,90000)
    }
    let result = tempObj
    
    console.log(result,'/mall4cloud_product/ua/spu/prod_info')
    return result
  }
)

// 接口/mall4cloud_product/ua/shop_detail/head_info
Mock.mock(
  new RegExp(VITE_API_URL + '/mall4cloud_product/ua/shop_detail/head_info' + '.*'),
  'get',
  (options?: object): any => {
    let tempObj = {
      shopLogo:Random.image('200x100', '#FF6600'),
      shopName:Random.ctitle(3,6),
      type:Random.integer(0,1)
    }
    let result = tempObj
    
    console.log(result,'/mall4cloud_product/ua/shop_detail/head_info')
    return result
  }
)
